//
//  WHGifHeader.m
//  BinFengExpressOwner
//
//  Created by 邓伟浩 on 2018/11/2.
//  Copyright © 2018年 BinFeng. All rights reserved.
//

#import "WHGifHeader.h"

@implementation WHGifHeader

- (void)prepare {
    [super prepare];
    
    // 设置普通状态的动画图片
//    NSMutableArray *idleImages = [NSMutableArray array];
//    for (NSUInteger i = 1; i<=60; i++) {
//        UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"dropdown_anim__000%zd", i]];
//        [idleImages addObject:image];
//    }
    self.automaticallyChangeAlpha = YES;
    // 隐藏时间
    self.lastUpdatedTimeLabel.hidden = YES;
    // 隐藏状态
    self.stateLabel.hidden = YES;
    
    [self setImages:@[IMAGE_NAMED(@"refresh_01")] forState:MJRefreshStateIdle];
    
    // 设置即将刷新状态的动画图片（一松开就会刷新的状态）
    NSMutableArray *refreshingImages = [NSMutableArray array];
    for (NSUInteger i = 0; i < 20; i++) {
        UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"dropdown_anim_000%zd", i]];
        [refreshingImages addObject:image];
    }
    [self setImages:@[IMAGE_NAMED(@"refresh_02")] forState:MJRefreshStatePulling];
    
    // 设置正在刷新状态的动画图片
    [self setImages:refreshingImages forState:MJRefreshStateRefreshing];
}

@end
